<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../Template/AdminTemplate.xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:define name="content">
        <div class="content-box"><!-- Start Content Box -->

            <div class="content-box-header">

                <h3>ORDER MANAGER</h3>
                <div class="clear"></div>

            </div> <!-- End .content-box-header -->

            <div class="content-box-content">

                <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
                    <h:panelGroup rendered="#{orderBean.message!=null}">
                        <div class="notification attention png_bg">
                            <a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
                            <div>
                                #{orderBean.message}
                            </div>
                        </div>
                    </h:panelGroup>

                    <table>

                        <thead>
                            <tr>
                                <th><input class="check-all" type="checkbox" /></th>
                                <th>Order Name</th>
                                <th>Customer ID</th>
                                <th>Order Price</th>
                                <th>Order Date</th>
                                <th>Order Status</th>
                                <th>Option</th>
                            </tr>
                        </thead>

                        <tfoot>
                            <tr>
                                <td colspan="6">
                                    <div class="pagination">
                                        <a href="#" title="First Page">&laquo; First</a><a href="#" title="Previous Page">&laquo; Previous</a>
                                        <a href="#" class="number current" title="1">1</a>
                                        <a href="#" class="number" title="2">2</a>
                                        <a href="#" class="number" title="3">3</a>
                                        <a href="#" class="number" title="4">4</a>
                                        <a href="#" title="Next Page">Next &raquo;</a><a href="#" title="Last Page">Last &raquo;</a>
                                    </div> <!-- End .pagination -->
                                    <div class="clear"></div>
                                </td>
                            </tr>
                        </tfoot>

                        
                        <ui:repeat value="#{orderBean.order1}" var="order">
                            <tbody>
                                <tr>
                                    <td><input type="checkbox" /></td>
                                    <td>#{order.shipName}</td>
                                    <td><a href="#" title="title">#{order.cusId}</a></td>
                                    <td>#{order.totelPrice}</td>
                                    <td>#{order.date}</td>
                                    <td>#{order.staName}</td>
                                    <td>
                                        <!-- Icons -->
                                        <a href="EditOrder.xhtml?id=#{order.id}" title="Edit"><img src="resources/images/icons/pencil.png" alt="Edit" /></a>
                                        <a href="#" title="Delete" ><img src="resources/images/icons/pencil.png" alt="Delete" /></a>
                                        <h:commandButton onclick="return confirm('Are you sure you want to delete?')" action="#{orderBean.deleteOrder(order.id)}" value="Delete">
                                            <f:param name="id" value="#{order.id}"/>
                                        </h:commandButton>
                                    </td>
                                </tr>
                            </tbody>
                        </ui:repeat>

                    </table>

                </div> <!-- End #tab1 -->
                <!-- End #tab2 -->
            </div>
            <!-- End .content-box-content -->

        </div>
    </ui:define>
</ui:composition>
